package com.zhiliao.demo2;

public class SingletonInstance {
    private volatile static SingletonInstance instance ;

    private SingletonInstance() {

    }

    public static SingletonInstance getInstance() {
        if (null == instance) {
            synchronized (SingletonInstance.class) {
                if (null == instance) {
                    instance = new SingletonInstance();
                }
            }
        }
        return instance;
    }

}
